From 2266e87a12feef815f45d53f84d97b232748fb3e Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Sat, 21 Nov 2020 15:05:48 -0600 Subject: [PATCH] Change route name from "home" to "pgwui_home" --- src/pgwui_common/pgwui_common.py | 6 +++--- src/pgwui_common/templates/auth_base.mak | 2 +- src/pgwui_common/templates/base.mak | 2 +- tests/test_pgwui_common.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pgwui_common/pgwui_common.py b/src/pgwui_common/pgwui_common.py index 66ff862..22acaf7 100644 --- a/src/pgwui_common/pgwui_common.py +++ b/src/pgwui_common/pgwui_common.py @@ -35,8 +35,8 @@ def base_view(wrapped): pgwui = response.get('pgwui', {}) routes = pgwui.setdefault('routes', dict()) - routes.setdefault('home', - request.route_url('home')) + routes.setdefault('pgwui_home', + request.route_url('pgwui_home')) try: logout_route = request.route_url('pgwui_logout') except KeyError: @@ -68,4 +68,4 @@ def includeme(config): 'static/pgwui_common', 'pgwui_common:static/', cache_max_age=3600) - config.add_route('home', DEFAULT_HOME_ROUTE) + config.add_route('pgwui_home', DEFAULT_HOME_ROUTE) diff --git a/src/pgwui_common/templates/auth_base.mak b/src/pgwui_common/templates/auth_base.mak index f484290..d5e28ef 100644 --- a/src/pgwui_common/templates/auth_base.mak +++ b/src/pgwui_common/templates/auth_base.mak @@ -52,7 +52,7 @@ <%def name="navbar()"> diff --git a/tests/test_pgwui_common.py b/tests/test_pgwui_common.py index 005bf04..7be6aac 100644 --- a/tests/test_pgwui_common.py +++ b/tests/test_pgwui_common.py @@ -57,7 +57,7 @@ def test_base_view_add(pyramid_request_config): pgwui_common.includeme(pyramid_request_config) wrapper = pgwui_common.base_view(mock_view) response = wrapper(request) - assert response['pgwui']['routes']['home'] == url + assert response['pgwui']['routes']['pgwui_home'] == url def test_base_view_default(pyramid_request_config): @@ -136,7 +136,7 @@ def test_includeme_configurecalled(): self.add_static_view_called = True def add_route(self, name, route): - if name == 'home': + if name == 'pgwui_home': self.home_route = route config = MockConfig() -- 2.34.1